﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'SearchVehiculoAlquilado')
	BEGIN
		DROP  Procedure  SearchVehiculoAlquilado
	END

GO

CREATE Procedure SearchVehiculoAlquilado

	(
		@nroPlaca nvarchar(10)
	)

AS

BEGIN
	SET NOCOUNT ON
	
	SELECT
	VA.[Contrato],
	VA.[IdBien],
	VA.[IdVehiculoAlquilado],
	VA.[MontoPago]
	FROM [VehiculoAlquilado] AS VA
	INNER JOIN Vehiculo AS V ON VA.[IdBien] = V.[IdBien]
	WHERE V.[NroPlaca] LIKE (@nroPlaca + N'%')

	SET NOCOUNT OFF
END

GO


GRANT EXEC ON SearchVehiculoAlquilado TO PUBLIC

GO


